import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { TestComponent } from './test/test.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import { TestGetDetailComponent } from './test-get-detail/test-get-detail.component';
import { DynamicFormComponent } from './dynamic-form/dynamic-form.component';
import { DynamicRenderComponent } from './dynamic-render/dynamic-render.component';

const routes: Routes = [
  { path: 'dashboard', component: DashboardComponent },
  { path: 'test', component: TestComponent },
  { path: 'detail/:id', component: TestGetDetailComponent },
  { path: 'dynamicform', component: DynamicFormComponent },
  { path: 'dynamicrender', component: DynamicRenderComponent },
  { path: 'route' , loadChildren: './routes/test/test.module#TestModule' },
  { path: 'identity' , loadChildren: './routes/identity/identity.module#IdentityModule' },
  { path: 'user' , loadChildren: './routes/user/user.module#UserModule' },
  // 默认路由
  { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
